package com.mall.users.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.model.domain.UmsAdmin;
import com.mall.model.domain.UmsRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author LQJdeDELL
* @description 针对表【ums_role(后台用户角色表)】的数据库操作Mapper
* @createDate 2023-03-09 22:29:17
* @Entity generator.domain.UmsRole
*/
public interface UmsRoleMapper extends BaseMapper<UmsRole> {

    Integer selectCount(String name);

    List<UmsRole> selectByPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, @Param("name") String name);

    @Select("select * from ums_role")
    List<UmsRole> selectAll();


    List<UmsRole> selectByIds(@Param("ids") List<Long> ids);


    void update(UmsRole umsRole);

    void save(UmsRole umsRole);

    @Select("select * from ums_role where name = #{name}")
    UmsRole selectByName(String name);

    void delete(@Param("ids") List<Long> ids);

    @Update("update ums_role set status = #{status} where id = #{id}")
    void updateStatus(Long id, Integer status);
}




